added samples
[windows-sources.git] / sdk / samples / all in on code / Visual Studio 2008 / VBSoftKeyboard / UserInteraction / NativeMethods.vb
blob4f53bf7df703fba26ea244700412a2380549011d
1 '*************************** Module Header ******************************'
2 ' Project: VBSoftKeyboard
3 ' Copyright (c) Microsoft Corporation.
4 '
5 ' This class contains the structures and the constants which are used in
6 ' the SendInput method.
7 '
8 '
9 ' This source is subject to the Microsoft Public License.
10 ' See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
11 ' All other rights reserved.
13 ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
14 ' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
15 ' WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
16 '*************************************************************************'
19 Imports System.Runtime.InteropServices
21 Namespace UserInteraction
22 Friend NotInheritable Class NativeMethods
24 ' The constants used in the INPUT structure.
25 Public Const INPUT_MOUSE As Integer = 0
26 Public Const INPUT_KEYBOARD As Integer = 1
27 Public Const INPUT_HARDWARE As Integer = 2
29 ' The constants used in the KEYBDINPUT structure.
30 Public Const KEYEVENTF_EXTENDEDKEY As Integer = &H1
31 Public Const KEYEVENTF_KEYUP As Integer = &H2
33 ''' <summary>
34 ''' Used by SendInput to store information for synthesizing input events such
35 ''' as keystrokes, mouse movement, and mouse clicks.
36 ''' http://msdn.microsoft.com/en-us/library/ms646270(VS.85).aspx
37 ''' </summary>
38 <StructLayout(LayoutKind.Sequential)> _
39 Public Structure INPUT
40 ''' <summary>
41 ''' INPUT_MOUSE 0
42 ''' INPUT_KEYBOARD 1
43 ''' INPUT_HARDWARE 2
44 ''' </summary>
45 Public type As Integer
46 Public inputUnion As NativeMethods.INPUTUNION
47 End Structure
50 ''' <summary>
51 ''' An INPUTUNION structure only contains one field.
52 ''' http://msdn.microsoft.com/en-us/library/ms646270(VS.85).aspx
53 ''' </summary>
54 <StructLayout(LayoutKind.Explicit)> _
55 Public Structure INPUTUNION
56 <FieldOffset(0)> _
57 Public hi As NativeMethods.HARDWAREINPUT
58 <FieldOffset(0)> _
59 Public ki As NativeMethods.KEYBDINPUT
60 <FieldOffset(0)> _
61 Public mi As NativeMethods.MOUSEINPUT
62 End Structure
64 ''' <summary>
65 ''' The information about a simulated hardware event.
66 ''' http://msdn.microsoft.com/en-us/library/ms646269(VS.85).aspx
67 ''' </summary>
68 <StructLayout(LayoutKind.Sequential)> _
69 Public Structure HARDWAREINPUT
70 Public uMsg As Integer
71 Public wParamL As Short
72 Public wParamH As Short
73 End Structure
75 ''' <summary>
76 ''' The information about a simulated keyboard event.
77 ''' http://msdn.microsoft.com/en-us/library/ms646271(VS.85).aspx
78 ''' </summary>
79 <StructLayout(LayoutKind.Sequential)> _
80 Public Structure KEYBDINPUT
81 Public wVk As Short
82 Public wScan As Short
83 Public dwFlags As Integer
84 Public time As Integer
85 Public dwExtraInfo As IntPtr
86 End Structure
88 ''' <summary>
89 ''' The information about a simulated mouse event.
90 ''' http://msdn.microsoft.com/en-us/library/ms646273(VS.85).aspx
91 ''' </summary>
92 <StructLayout(LayoutKind.Sequential)> _
93 Public Structure MOUSEINPUT
94 Public dx As Integer
95 Public dy As Integer
96 Public mouseData As Integer
97 Public dwFlags As Integer
98 Public time As Integer
99 Public dwExtraInfo As IntPtr
100 End Structure
101 End Class
103 End Namespace